05:00
The basics
Settings > Extensions
Search “quarto” in extensions search bar
Click the Quarto extension
Click “Install in pycon-quarto…”
File > New File… > Quarto Document (qmd)
Set title and output format
Click Render (or type Ctrl+Shift+K)
VS Code screenshot
Terminal > New Terminal
Preview your document:
quarto preview my_doc.qmd
quarto render my_doc.qmd
---
title: "A very cool title"
author: "Me"
date: "12 November 2022"
format: html
jupyter: python3
---jupyter option to select the Jupyter kernelNote
YAML: Yet Another Markup Language
File > New File… > Quarto Document (qmd)
Add a YAML declaring a title, author and HTML output
05:00
| Markdown | Output |
|---|---|
**bold** |
bold |
__bold__ |
bold |
*italic* |
italic |
_italic_ |
italic |
~~strikethrough~~ |
|
^superscript^ |
superscript |
~subscript~ |
subscript |
-, + or *)Add the text from task02.txt to your Quarto doc
Match the formatting (italics, bold, links) of the first sentence in the Adelie Penguin wiki
Add an image of the Adelie Penguin (there’s one in the exercises folder)
Can you add the penguin emoji to your text?
10:00
species island bill_length_mm ... body_mass_g sex year
0 Adelie Torgersen 39.1 ... 3750.0 male 2007
1 Adelie Torgersen 39.5 ... 3800.0 female 2007
2 Adelie Torgersen 40.3 ... 3250.0 female 2007
3 Adelie Torgersen NaN ... NaN NaN 2007
4 Adelie Torgersen 36.7 ... 3450.0 female 2007
.. ... ... ... ... ... ... ...
339 Chinstrap Dream 55.8 ... 4000.0 male 2009
340 Chinstrap Dream 43.5 ... 3400.0 female 2009
341 Chinstrap Dream 49.6 ... 3775.0 male 2009
342 Chinstrap Dream 50.8 ... 4100.0 male 2009
343 Chinstrap Dream 50.2 ... 3775.0 female 2009
[344 rows x 8 columns]
Control properties of the code within the chunk and it’s outputs
Controlled using YAML within the code chunks
| Option | Purpose | Default value |
|---|---|---|
echo |
Show/hide code chunks in the output | true |
eval |
Whether to evaluate code within the chunk | true |
warning |
Show/hide messages/warnings produced by code in the output | true |
error |
Allow the code to error but show the error in the output | false |
echo
Use to show / hide code
produces
species island bill_length_mm ... body_mass_g sex year
0 Adelie Torgersen 39.1 ... 3750.0 male 2007
1 Adelie Torgersen 39.5 ... 3800.0 female 2007
2 Adelie Torgersen 40.3 ... 3250.0 female 2007
3 Adelie Torgersen NaN ... NaN NaN 2007
4 Adelie Torgersen 36.7 ... 3450.0 female 2007
.. ... ... ... ... ... ... ...
339 Chinstrap Dream 55.8 ... 4000.0 male 2009
340 Chinstrap Dream 43.5 ... 3400.0 female 2009
341 Chinstrap Dream 49.6 ... 3775.0 male 2009
342 Chinstrap Dream 50.8 ... 4100.0 male 2009
343 Chinstrap Dream 50.2 ... 3775.0 female 2009
[344 rows x 8 columns]
warning
Show / hide warnings produced by code in the output
array(['Torgersen'], dtype=object)
<string>:1: FutureWarning: The 'lookup' method is deprecated and will be removed in a future version. You can use DataFrame.melt and DataFrame.loc as a substitute.
Not anymore…
Open the document task03.qmd
Under the analysis subheading, add a code chunk to import Pandas
Hide the code chunk with #| echo: false
Add another code chunk to read in the penguins data (link in doc) and display it i.e.
Make the data loading chunk a collapsed code chunk with #| echo: fenced and #| code-fold: true
10:00
Flipper vs bill length of penguin species across three years
| fruit | count | color |
|--------|--------|--------|
| banana | 5 | yellow |
| apple | 6 | red |
| pear | 2 | green || fruit | count | color |
|---|---|---|
| banana | 5 | yellow |
| apple | 6 | red |
| pear | 2 | green |
| fruit | count | color |
|---|---|---|
| banana | 5 | yellow |
| apple | 6 | red |
| pear | 2 | green |
species island bill_length_mm ... body_mass_g sex year
0 Adelie Torgersen 39.1 ... 3750.0 male 2007
1 Adelie Torgersen 39.5 ... 3800.0 female 2007
2 Adelie Torgersen 40.3 ... 3250.0 female 2007
3 Adelie Torgersen NaN ... NaN NaN 2007
4 Adelie Torgersen 36.7 ... 3450.0 female 2007
.. ... ... ... ... ... ... ...
339 Chinstrap Dream 55.8 ... 4000.0 male 2009
340 Chinstrap Dream 43.5 ... 3400.0 female 2009
341 Chinstrap Dream 49.6 ... 3775.0 male 2009
342 Chinstrap Dream 50.8 ... 4100.0 male 2009
343 Chinstrap Dream 50.2 ... 3775.0 female 2009
[344 rows x 8 columns]
| species | island | bill_length_mm | bill_depth_mm | flipper_length_mm | body_mass_g | sex | year |
|---|---|---|---|---|---|---|---|
| Adelie | Torgersen | 39.1 | 18.7 | 181 | 3750 | male | 2007 |
| Adelie | Torgersen | 39.5 | 17.4 | 186 | 3800 | female | 2007 |
| Adelie | Torgersen | 40.3 | 18 | 195 | 3250 | female | 2007 |
| Adelie | Torgersen | nan | nan | nan | nan | nan | 2007 |
| Adelie | Torgersen | 36.7 | 19.3 | 193 | 3450 | female | 2007 |
| species | bill_length_mm | bill_depth_mm | flipper_length_mm | body_mass_g | year |
|---|---|---|---|---|---|
| Adelie | 38.7914 | 18.3464 | 189.954 | 3700.66 | 2008.01 |
| Chinstrap | 48.8338 | 18.4206 | 195.824 | 3733.09 | 2007.97 |
| Gentoo | 47.5049 | 14.9821 | 217.187 | 5076.02 | 2008.08 |
Open the document task04.qmd
Add a table displaying the first five rows of the data (use the empty code chunk provided).
Add a plot showing the distribution of bill length for each sex and species. Use the plotting code below:
fig-cap code chunk option.10:00